\(\int \frac {\sec (a+b \log (c x^n))}{x} \, dx\) [240]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 19 \[ \int \frac {\sec \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\text {arctanh}\left (\sin \left (a+b \log \left (c x^n\right )\right )\right )}{b n} \]

[Out]

arctanh(sin(a+b*ln(c*x^n)))/b/n

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {3855} \[ \int \frac {\sec \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\text {arctanh}\left (\sin \left (a+b \log \left (c x^n\right )\right )\right )}{b n} \]

[In]

Int[Sec[a + b*Log[c*x^n]]/x,x]

[Out]

ArcTanh[Sin[a + b*Log[c*x^n]]]/(b*n)

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \sec (a+b x) \, dx,x,\log \left (c x^n\right )\right )}{n} \\ & = \frac {\text {arctanh}\left (\sin \left (a+b \log \left (c x^n\right )\right )\right )}{b n} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \frac {\sec \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\text {arctanh}\left (\sin \left (a+b \log \left (c x^n\right )\right )\right )}{b n} \]

[In]

Integrate[Sec[a + b*Log[c*x^n]]/x,x]

[Out]

ArcTanh[Sin[a + b*Log[c*x^n]]]/(b*n)

Maple [A] (verified)

Time = 0.47 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.68

method result size
derivativedivides \(\frac {\ln \left (\sec \left (a +b \ln \left (c \,x^{n}\right )\right )+\tan \left (a +b \ln \left (c \,x^{n}\right )\right )\right )}{n b}\) \(32\)
default \(\frac {\ln \left (\sec \left (a +b \ln \left (c \,x^{n}\right )\right )+\tan \left (a +b \ln \left (c \,x^{n}\right )\right )\right )}{n b}\) \(32\)
parallelrisch \(\frac {-\ln \left (\tan \left (\frac {a}{2}+b \ln \left (\sqrt {c \,x^{n}}\right )\right )-1\right )+\ln \left (\tan \left (\frac {a}{2}+b \ln \left (\sqrt {c \,x^{n}}\right )\right )+1\right )}{n b}\) \(47\)
risch \(\frac {\ln \left (c^{i b} \left (x^{n}\right )^{i b} {\mathrm e}^{-\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}} {\mathrm e}^{\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}} {\mathrm e}^{-\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{i a}+i\right )}{b n}-\frac {\ln \left (c^{i b} \left (x^{n}\right )^{i b} {\mathrm e}^{-\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}} {\mathrm e}^{\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}} {\mathrm e}^{-\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{i a}-i\right )}{b n}\) \(229\)

[In]

int(sec(a+b*ln(c*x^n))/x,x,method=_RETURNVERBOSE)

[Out]

1/n/b*ln(sec(a+b*ln(c*x^n))+tan(a+b*ln(c*x^n)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 43 vs. \(2 (19) = 38\).

Time = 0.25 (sec) , antiderivative size = 43, normalized size of antiderivative = 2.26 \[ \int \frac {\sec \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\log \left (\sin \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) + 1\right ) - \log \left (-\sin \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) + 1\right )}{2 \, b n} \]

[In]

integrate(sec(a+b*log(c*x^n))/x,x, algorithm="fricas")

[Out]

1/2*(log(sin(b*n*log(x) + b*log(c) + a) + 1) - log(-sin(b*n*log(x) + b*log(c) + a) + 1))/(b*n)

Sympy [A] (verification not implemented)

Time = 0.99 (sec) , antiderivative size = 51, normalized size of antiderivative = 2.68 \[ \int \frac {\sec \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=- \begin {cases} - \log {\left (x \right )} \sec {\left (a \right )} & \text {for}\: b = 0 \\- \log {\left (x \right )} \sec {\left (a + b \log {\left (c \right )} \right )} & \text {for}\: n = 0 \\- \frac {\log {\left (\tan {\left (a + b \log {\left (c x^{n} \right )} \right )} + \sec {\left (a + b \log {\left (c x^{n} \right )} \right )} \right )}}{b n} & \text {otherwise} \end {cases} \]

[In]

integrate(sec(a+b*ln(c*x**n))/x,x)

[Out]

-Piecewise((-log(x)*sec(a), Eq(b, 0)), (-log(x)*sec(a + b*log(c)), Eq(n, 0)), (-log(tan(a + b*log(c*x**n)) + s
ec(a + b*log(c*x**n)))/(b*n), True))

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.63 \[ \int \frac {\sec \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\log \left (\sec \left (b \log \left (c x^{n}\right ) + a\right ) + \tan \left (b \log \left (c x^{n}\right ) + a\right )\right )}{b n} \]

[In]

integrate(sec(a+b*log(c*x^n))/x,x, algorithm="maxima")

[Out]

log(sec(b*log(c*x^n) + a) + tan(b*log(c*x^n) + a))/(b*n)

Giac [F]

\[ \int \frac {\sec \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\int { \frac {\sec \left (b \log \left (c x^{n}\right ) + a\right )}{x} \,d x } \]

[In]

integrate(sec(a+b*log(c*x^n))/x,x, algorithm="giac")

[Out]

integrate(sec(b*log(c*x^n) + a)/x, x)

Mupad [B] (verification not implemented)

Time = 29.58 (sec) , antiderivative size = 66, normalized size of antiderivative = 3.47 \[ \int \frac {\sec \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {\ln \left (\frac {2\,{\mathrm {e}}^{a\,1{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,1{}\mathrm {i}}-2{}\mathrm {i}}{x}\right )}{b\,n}+\frac {\ln \left (\frac {2\,{\mathrm {e}}^{a\,1{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,1{}\mathrm {i}}+2{}\mathrm {i}}{x}\right )}{b\,n} \]

[In]

int(1/(x*cos(a + b*log(c*x^n))),x)

[Out]

log((2*exp(a*1i)*(c*x^n)^(b*1i) + 2i)/x)/(b*n) - log((2*exp(a*1i)*(c*x^n)^(b*1i) - 2i)/x)/(b*n)